<template>
  <el-container style="width:80%;">
    <el-header class="auto">
      <goback :content="content"></goback>
    </el-header>
    <el-main>
    <el-form  ref="form" :model="form">
      <el-form-item label="签到内容">
        <el-input
          type="textarea"
          placeholder="请输入内容"
          v-model="form.desc">
        </el-input>
      </el-form-item>
      <el-form-item style="text-align: center;">
        <el-button type="primary" @click="onSubmit">立即签到</el-button>
        <el-button>取消</el-button>
      </el-form-item>

    </el-form>
    </el-main>
  </el-container>
</template>

<script>
import goback from "../common/goback";
import {singin} from "@/apilist/Admin"
export default {
  name: "sign",
  data(){
    return {
        content:"签到/签退",
        form : {
            desc: '',
        }
    }
  },
  components:{goback},
    methods: {
        onSubmit(){
            singin(this.form).then((res) => {
                this.$message(
                    {type: 'success',
                    message: res.msg,
                    onClose: () => {
                        this.$router.push('/home')
                    },
                    }
                    );
            });
        }
    },
}
</script>

<style scoped>

</style>





